package com.lanou.zakerproject.hotspot;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lanou.zakerproject.R;
import com.lanou.zakerproject.base.BaseActivity;

/**
 * Created by dllo on 16/1/19.
 */
public class HotSpotDetailActivity extends BaseActivity {
    private WebView webview;
    private String pk;
    private String URL;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.new_webview);
        webview = (WebView) findViewById(R.id.news_subscribe_webview);
        Intent intent = getIntent();
        pk = intent.getStringExtra("pk");
        URL = "http://iphone.myzaker.com/l.php?l=" + pk;
        webview.getSettings().setJavaScriptEnabled(true);
        //加载需要显示的网页
        webview.loadUrl(URL);
        //设置Web视图
//        setContentView(webview);
        webview.setWebViewClient(new WebViewClient() {
            //  重写此方法表明点击网页里面的链接还是在当前的webview里跳转，不跳到浏览器那边
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                //  重写此方法表明点击网页里面的链接还是在当前的webview里跳转，不跳到浏览器那边
                view.loadUrl(url);
                return true;
            }
        });

    }

}
